Convert decimal to hexadecimalΒΆ
Write a python program to convert decimal to hexadecimal.
Sample decimal number:
30, 4
Expected output:
1e, 04
x = 30
print(format(x, '02x'))
x = 4
print(format(x, '02x'))
Output:
1e
04
x = 30
print(format(x, '02x'))
x = 4
print(format(x, '02x'))
Output:
1e
04